import React, { FC, useEffect, useState } from "react"
import { Pagination } from "antd"
import { LIST_PAGE_SIZE } from "../constant"
import { useSearchParams } from "react-router-dom"

type PropsType = {
  total: number
}

const ListPage: FC<PropsType> = (props: PropsType) => {
  const { total } = props
  const [current, setCurrent] = useState(1)
  const [pageSize, setPageSize] = useState(LIST_PAGE_SIZE)

  // 从url参数中找到page pageSize,并且同步到Pagination组件中
  const [searchParams] = useSearchParams()
  useEffect(() => {
    const page = 
  }, [searchParams])
  return (
    <Pagination
      current={current}
      pageSize={pageSize}
      total={total}
    ></Pagination>
  )
}

export default ListPage
